package org.example.apitest.beans;

import lombok.Data;

@Data
public class SensorReading {
    private String id;
    private Long timestamp;
    private Double temperature;

    public SensorReading() {
    }

    public SensorReading(String value) {
        String[] fields = value.split(",");
        this.id = fields[0];
        this.timestamp = new Long(fields[1]);
        this.temperature = new Double(fields[2]);
    }

    public SensorReading(String id, Long timestamp, Double temperature) {
        this.id = id;
        this.timestamp = timestamp;
        this.temperature = temperature;
    }
}
